package com.hjl.spring6.bean.iocXml.life;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.lang.Nullable;

/**
 * @author ServivE
 * @version 0.1
 * @className MyBeanPostProcessor
 * @description
 * @date 2024/8/6 17:00
 * @since jdk11
 */
public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("生命周期： 3.bean后置处理器，初始化之前执行");
        System.out.println(beanName + "::" + bean);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("生命周期： 5.bean后置处理器，初始化之后执行");
        System.out.println(beanName + "::" + bean);
        return bean;
    }
}
